package bb.lanxing.mvvm.base;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

import bb.lanxing.fragment.base.BaseFragment;

public abstract class BaseDBFragment<T extends ViewDataBinding> extends BaseFragment {
    private T binding;

    public abstract void initView(T t);

    public BaseDBFragment(int i) {
        super(i);
    }

    public final T getBinding() {
        return this.binding;
    }

    @Override
    public void onViewCreated(@NonNull View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        binding= DataBindingUtil.bind(view);
        initView(binding);
    }
}